﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameServer.Networking.Packets
{
    class PACKET_ROOM_UPDATE : Packet
    {
        public PACKET_ROOM_UPDATE(Virtual_Objects.Room.virtualRoom Room, int RoomExist = 1)
        {
            //29200 76 1 76 2 2 0 Aufgeht's! 0 8 2 43 0 0 2 2 3 1 0 1 0 0 0 1 0 30 0 -1
            newPacket(29200);
            addBlock(Room.ID);
            addBlock(1);
            addBlock(Room.ID);
            addBlock(Room.RoomStatus);
            addBlock(Room.RoomStatus);
            addBlock(Room.RoomMasterSlot);
            addBlock(Room.Name);
            addBlock(Room.EnablePassword);
            addBlock(Room.MaxPlayers);
            addBlock(Room.PlayerCount);
            addBlock(Room.MapID);
            addBlock(Room.Rounds);
            addBlock(Room.Rounds);
            addBlock(Room.TimeLimit);
            addBlock(Room.Mode);
            addBlock(4);
            addBlock(Room.isJoinAble() ? 1 : 0); // 0 = unjoinable(grey room) // Once We are almost over
            addBlock(3);
            addBlock(Room.SuperMaster ? 1 : 0); // 1 = Room has Supermaster
            addBlock(Room.RoomType);
            addBlock(Room.LevelLimit);
            addBlock(Room.PremiumOnly);
            addBlock(Room.VoteKick);
            addBlock(0);
            addBlock(Room.Ping);
            addBlock(Room.Ping);
            addBlock(-1);
        }
    }
}
